package com.zmytest.annotation.scope.request;

import com.zmytest.annotation.scope.prototype.ScopePrototype;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created on 2018/12/29.
 *
 * @author zhangmingyu
 */
@RestController
@RequestMapping("/annotation/scope/request")
public class ScopeRequestController {

    @Autowired
    private Service1 service1;
    @Autowired
    private ScopeRequest scopeRequest;

    @GetMapping("/test/{name}")
    public void test(@PathVariable("name")String name){
        scopeRequest.setName(name);
        service1.test();
    }
}
